package com.jingdianjichi.circle.server.config.websocket;

import com.jingdianjichi.practice.server.util.LoginUtil;

import javax.websocket.HandshakeResponse;
import javax.websocket.server.HandshakeRequest;
import javax.websocket.server.ServerEndpointConfig;

public class WebSocketServerConfig extends ServerEndpointConfig.Configurator {
    @Override
    public boolean checkOrigin(String originHeaderValue) {
        return true;
    }
    @Override
    public void modifyHandshake(ServerEndpointConfig sec,
                                HandshakeRequest request,
                                HandshakeResponse response) {

        sec.getUserProperties().put("erp", LoginUtil.getLoginId());
    }
}
